package com.kgc.chen;

public class maoPao {
    public static void main(String[] args) {
        int []nums=new int[]{3,9,6,4,1,8};
        for (int i=0;i<nums.length-1;i++){
            for (int j=0;j<nums.length-1-i;j++){
                if (nums[j]>nums[j+1]){
//                    int tmp=nums[j];
//                    nums[j]=nums[j+1];
//                    nums[j+1]=tmp;
                   /* nums[j]=nums[j]+nums[j+1];
                    nums[j+1]=nums[j]-nums[j+1];
                    nums[j]=nums[j]-nums[j+1];*/
                    nums[j]=nums[j]^nums[j+1];
                    nums[j+1]=nums[j]^nums[j+1];
                    nums[j]=nums[j]^nums[j+1];

                }
            }
        }
        for ( int num:nums){
            System.out.print(num+"\t");
        }
    }
}